package com.netas.kekmanager.dao;

import com.netas.kekmanager.dao.model.Comment;
import com.netas.kekmanager.dao.model.CommentPk;
import com.netas.kekmanager.dao.exceptions.CommentDaoException;
import java.util.Date;
import java.util.List;

public interface CommentDao
{
	/**
	 * Method 'insert'
	 * 
	 * @param dto
	 * @return CommentPk
	 */
	public CommentPk insert(Comment dto);

	/** 
	 * Updates a single row in the comment table.
	 */
	public void update(CommentPk pk, Comment dto) throws CommentDaoException;

	/** 
	 * Deletes a single row in the comment table.
	 */
	public void delete(CommentPk pk) throws CommentDaoException;

	/** 
	 * Returns all rows from the comment table that match the criteria 'id = :id'.
	 */
	public Comment findByPrimaryKey(int id) throws CommentDaoException;

	/** 
	 * Returns all rows from the comment table that match the criteria ''.
	 */
	public List<Comment> findAll() throws CommentDaoException;

	/** 
	 * Returns all rows from the comment table that match the criteria 'user_id = :userId'.
	 */
	public List<Comment> findByUser(int userId) throws CommentDaoException;

	/** 
	 * Returns all rows from the comment table that match the criteria 'web_resource_id = :webResourceId'.
	 */
	public List<Comment> findByWebResource(int webResourceId) throws CommentDaoException;

	/** 
	 * Returns all rows from the comment table that match the criteria 'id = :id'.
	 */
	public List<Comment> findWhereIdEquals(int id) throws CommentDaoException;

	/** 
	 * Returns all rows from the comment table that match the criteria 'text = :text'.
	 */
	public List<Comment> findWhereTextEquals(String text) throws CommentDaoException;

	/** 
	 * Returns all rows from the comment table that match the criteria 'user_id = :userId'.
	 */
	public List<Comment> findWhereUserIdEquals(int userId) throws CommentDaoException;

	/** 
	 * Returns all rows from the comment table that match the criteria 'web_resource_id = :webResourceId'.
	 */
	public List<Comment> findWhereWebResourceIdEquals(int webResourceId) throws CommentDaoException;

	/** 
	 * Returns all rows from the comment table that match the criteria 'time = :time'.
	 */
	public List<Comment> findWhereTimeEquals(Date time) throws CommentDaoException;

	/** 
	 * Returns the rows from the comment table that matches the specified primary-key value.
	 */
	public Comment findByPrimaryKey(CommentPk pk) throws CommentDaoException;

}
